<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title></title>
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
		<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
		<style type="text/css">
			.ui-page {
				background: white;
			}
			
			.ui-header {
				background-color: #5693C0 ! important;
				text-shadow: 0 1px 0 #3D586C ! important;
				padding-bottom: 5px;
			}
			
			.ui-content {
				padding: 0px 1em;
			}
			
			.ui-footer {
				color: #3D586C ! important;
				background: none ! important;
			}
			
			.ui-header, .ui-footer {
				border: none ! important;
			}
			
			.starRating {
				font-size: 26px;
			}
			
			.starRating .fa {
				cursor: pointer;
			}
			
			.starRating .fa-star {
				color: #3388CC;
			}
			
			.subbtn {
				opacity: 1 ! important;
				color: white;
			}
			
			.quTitleNum {
				/* position: absolute; */
				
			}
			
			.quTitleText {
				/* text-indent: 2em; */
				
			}
			
			#dwSurveyNote {
				padding-top: 0px;
			}
			
			.m_quOrderByUi {
				margin: 5px 0 5px 0;
				padding: 0;
				border: 1px solid #d5d5d5;
				border-radius: 3px;
			}
			
			.m_quOrderByUi li {
				border-color: #fff;
				font-size: 16px;
				min-height: 41px;
				position: relative;
				padding-right: 45px !important;
				border-bottom: 1px solid #EBEBEB !important;
			}
			
			.m_orderby_num {
				position: absolute;
				right: 10px;
				top: 55%;
				margin-top: -15px;
				min-width: 26px;
				height: 26px;
				background: #85C8FF;
				color: #fff;
				text-align: center;
				line-height: 26px;
				border-radius: 15px;
				z-index: 100;
				display: none;
			}
			
			.m_orderby_sel {
				position: absolute;
				top: 0px;
				left: 0px;
				width: 100%;
				height: 100%;
				opacity: 0;
				font-size: 30px;
				z-index: 9999;
				background-color: rgb(248, 248, 248);
				border: 1px solid rgb(166, 166, 166);
				border-image-source: initial;
				border-image-slice: initial;
				border-image-width: initial;
				border-image-outset: initial;
				border-image-repeat: initial;
				display: inline-block;
			}
			
			#wrap{
				overflow-x: hidden;
				margin: 0px 5px;
			}
			#dwSurveyName{
				width: auto;
			}
			#dwSurveyNoteEdit{
				width: auto;
				padding-right: 10px;
			}
			.surveyQuItem .surveyQuItemContent{
				width: calc(100% - 20px);
			}
			.surveyQuItem .surveyQuItemContent .quCoTitle .quCoTitleEdit{
				width: calc(100% - 45px);
			}
			table.quCoChenTable{
				width: auto;
			}
			table.quCoChenTable tr td{
				min-width: 80px;
			}
			@media screen and (max-width: 960px){
			  /* 手机端CSS代码 */
			  #dw_body_content{
			  	width: 100%;
			  }
			}
			 
			@media screen and (min-width: 960px){
			  /* 电脑端CSS代码 */
			  #dw_body_content{
			  	width: 60%;
			  }
			}
			#dwSurveyQuContentAppUl{
				padding-bottom: 50px;
			}
			.detail-show{
				
			}
			.number-show{
				width: 25px;
			    height: 25px;
			    border-radius: 12px;
			    background-color: burlywood;
			    color: white;
			    float: right;
			    margin-top: 5px;
			    margin-right: 5px;
			    text-align: center;
			    line-height: 25px;
			}
			.fraction{
				font-size: 13px;
				color: gray;
				white-space: nowrap;
			}
			.has-fraction{
				font-size: 13px;
				color: blue;
				white-space: nowrap;
			}
			.pg{
				color: #FF0000 !important;
			}
			
			.kx{
				color: #1AAD19 !important;
			}
		</style>
	</head>

	<body style="background-color: RGB(232,233,235);">
		<div id="wrap">

		</div>
		<div class="footer-copyright footer-pb" style="color: gray;padding-bottom: 5px;">
			源码地址:
			<a href="https://gitee.com/doc_wei01/skyeye" style="text-decoration: none;color: gray;">skyeye</a>&nbsp;
		</div>
		
		<!-- 1单选题radio -->
		<script type="text/x-handlebars-template" id="radioTemplate">
			<div class="surveyQuItem">
				<div class="surveyQuItemContent">
					<div class="quCoTitle">
						<div class="quCoNum">{{showQuestionIndex quType}}、</div>
						<div class="quCoTitleEdit" >{{quTitle}}<span class="fraction">（{{fraction}}分）</span><span class="has-fraction">（得{{hasFraction}}分）</span></div>
					</div>
					<div class="showOtherFile">
						
					</div>
					<div class="quCoItem">
					{{#if hv}}
						{{#compare1 hv '3'}}
							<table class='tableQuColItem'>
								{{#each questionRadio}}
									<tr>
										{{#cellCount001 cellCount}}{{/cellCount001}}
									</tr>
								{{/each}}
								<tr>
							</table>
						{{else}}
						{{#if hv}}
						{{#compare1 hv '1'}}
							<ul class="transverse">
								{{#each questionRadio}}
									<li class="quCoItemUlLi">
										<div class="dwQuOptionItemContent">
											<label class="dwRedioStyle dwQuInputLabel {{#compareCheck id ../answer.quItemId}}{{/compareCheck}}" ></label>
											<label class="quCoOptionEdit quCoOptionPadding">{{optionName}}</label>
											<span class="detail-show" style="{{#compare2 isNote 0}}{{/compare2}}">{{../answer.otherText}}</span>
										</div>
									</li>
								{{/each}}
							</ul>
						{{else}}
							<ul>
								{{#each questionRadio}}
									<li class="quCoItemUlLi">
										<div class="dwQuOptionItemContent">
											<label class="dwRedioStyle dwQuInputLabel {{#compareCheck id ../answer.quItemId}}{{/compareCheck}}" ></label>
											<label class="quCoOptionEdit quCoOptionPadding">{{optionName}}</label>
											<span class="detail-show" style="{{#compare2 isNote 0}}{{/compare2}}">{{../answer.otherText}}</span>
										</div>
									</li>
								{{/each}}
							</ul>
						{{/compare1}}
						{{/if}}
					{{/compare1}}
					{{/if}}
					</div>
					<fieldset class="layui-elem-field site-demo-button">
						<legend>上传图片答案</legend>
  						<div>
    						<div class="upload questionPicture" id="questionPicture{{id}}"></div>
  						</div>
					</fieldset>
				</div>
			</div>
		</script>
		
		<!-- 2多选题checkbox -->
		<script type="text/x-handlebars-template" id="checkBoxTemplate">
			<div class="surveyQuItem">
				<div class="surveyQuItemContent">
					<div class="quCoTitle">
						<div class="quCoNum">{{showQuestionIndex quType}}、</div>
						<div class="quCoTitleEdit" >{{quTitle}}<span class="fraction">（{{fraction}}分）</span><span class="has-fraction">（得{{hasFraction}}分）</span></div>
					</div>
					<div class="showOtherFile">
						
					</div>
					<div class="quCoItem">
						{{#if hv}}
						{{#compare1 hv '3'}}
								<table class='tableQuColItem'>
									{{#each questionCheckBox}}
										<tr>
											{{#cellCount002 cellCount}}{{/cellCount002}}
										</tr>
									{{/each}}
								</table>
							{{else}}
								{{#if hv}}
								{{#compare1 hv '1'}}
										<ul class="transverse">
											{{#each questionCheckBox}}
												<li class="quCoItemUlLi">
													<div class="dwQuOptionItemContent">
														<label class="dwCheckboxStyle dwQuInputLabel 
															{{#each ../answer}}
																{{#compareCheck ../id quItemId}}{{/compareCheck}}
															{{/each}}
														" ></label>
														<label class="quCoOptionEdit quCoOptionPadding">{{optionName}}</label>
														<span class="detail-show" style="{{#compare2 isNote 0}}{{/compare2}}">
															{{#each ../answer}}
																{{#compareCheckReturnStr ../id quItemId otherText}}{{/compareCheckReturnStr}}
															{{/each}}
														</span>
													</div>
												</li>
											{{/each}}
										</ul>
									{{else}}
										<ul>
											{{#each questionCheckBox}}
												<li class="quCoItemUlLi">
													<div class="dwQuOptionItemContent">
														<label class="dwCheckboxStyle dwQuInputLabel 
															{{#each ../answer}}
																{{#compareCheck ../id quItemId}}{{/compareCheck}}
															{{/each}}
														" ></label>
														<label class="quCoOptionEdit quCoOptionPadding">{{optionName}}</label>
														<span class="detail-show" style="{{#compare2 isNote 0}}{{/compare2}}">
															{{#each ../answer}}
																{{#compareCheckReturnStr ../id quItemId otherText}}{{/compareCheckReturnStr}}
															{{/each}}
														</span>
													</div>
												</li>
											{{/each}}
										</ul>
								{{/compare1}}
								{{/if}}
						{{/compare1}}
						{{/if}}
					</div>
					<fieldset class="layui-elem-field site-demo-button">
						<legend>上传图片答案</legend>
  						<div>
    						<div class="upload questionPicture" id="questionPicture{{id}}"></div>
  						</div>
					</fieldset>
				</div>
			</div>
		</script>
		
		<!-- 3填空题fillblank -->
		<script type="text/x-handlebars-template" id="fillblankTemplate">
			<div class="surveyQuItem">
				<div class="surveyQuItemContent">
					<div class="quCoTitle">
						<div class="quCoNum">{{showQuestionIndex quType}}、</div>
						<div class="quCoTitleEdit" >{{quTitle}}<span class="fraction">（{{fraction}}分）</span><span class="has-fraction">（得{{hasFraction}}分）</span></div>
					</div>
					<div class="showOtherFile">
						
					</div>
					<div class="quCoItem"><ul>
						<li class="quCoItemUlLi">
							<div class="quFillblankItem">
								<span class="detail-show">{{answer.answer}}</span>
								<div class="dwComEditMenuBtn" ></div>
							</div>
						</li>
					</ul>
					</div>
					<fieldset class="layui-elem-field site-demo-button">
						<legend>上传图片答案</legend>
  						<div>
    						<div class="upload questionPicture" id="questionPicture{{id}}"></div>
  						</div>
					</fieldset>
				</div>
			</div>
		</script>
		
		<!-- 9排序题orderby -->
		<script type="text/x-handlebars-template" id="orderbyTemplate">
			<div class="surveyQuItem">
				<div class="surveyQuItemContent">
					<div class="quCoTitle">
						<div class="quCoNum">{{showQuestionIndex quType}}、</div>
						<div class="quCoTitleEdit">{{quTitle}}<span class="fraction">（{{fraction}}分）</span><span class="has-fraction">（得{{hasFraction}}分）</span></div>
					</div>
					<div class="showOtherFile">
						
					</div>
					<div class="quCoItem quOrderByCoItem">
						<div  class="quOrderByLeft">
							<ul class="quOrderByLeftUl">
								{{#each questionOrderBy}}
									<li class="quCoItemUlLi">
										<label class="quCoOptionEdit">{{optionName}}
											<span class="detail-show number-show">
												{{#each ../answer}}
													{{#compareCheckReturnStr ../id quRowId orderyNum}}{{/compareCheckReturnStr}}
												{{/each}}
											</span>
										</label>
									</li>
								{{/each}}
							</ul>
						</div>
						<div style="clear: both;"></div>
					</div>
					<fieldset class="layui-elem-field site-demo-button">
						<legend>上传图片答案</legend>
  						<div>
    						<div class="upload questionPicture" id="questionPicture{{id}}"></div>
  						</div>
					</fieldset>
				</div>
			</div>
		</script>
		
		<!-- 16分页pagetag -->
		<script type="text/x-handlebars-template" id="pagetagTemplate">
			<div class="surveyQuItem">
				<div class="pageBorderTop nohover"></div>
				<div class="surveyQuItemContent" style="padding-top: 12px;height: 30px;min-height: 30px;">
					<a href="#" class="sbtn24 sbtn24_0 nextPage_a" >下一页</a>&nbsp;&nbsp;
					{{#if pageNo}}
					{{#compare7 pageNo}}
						<a href="#" class="sbtn24 sbtn24_1 prevPage_a">上一页</a>
						{{else}}
					{{/compare7}}
					{{/if}}
					<input type="hidden" name="nextPageNo" value="{{pageNo}}">
				</div>
			</div>
		</script>
		
		<!-- 17段落paragraph -->
		<script type="text/x-handlebars-template" id="paragraphTemplate">
			<div class="surveyQuItem">
				<div class="surveyQuItemContent" style="min-height: 35px;">
					<div class="quCoTitle" style="background: rgb(243, 247, 247);">
						<div class="quCoTitleEdit" style="padding-left: 15px;">{{quTitle}}</div>
					</div>
				</div>
			</div>
		</script>
		
		<!-- 4多项填空题multi-fillblank -->
		<script type="text/x-handlebars-template" id="multiFillblankTemplate">
			<div class="surveyQuItem">
				<div class="surveyQuItemContent">
					<div class="quCoTitle">
						<div class="quCoNum">{{showQuestionIndex quType}}、</div>
						<div class="quCoTitleEdit" >{{quTitle}}<span class="fraction">（{{fraction}}分）</span><span class="has-fraction">（得{{hasFraction}}分）</span></div>
					</div>
					<div class="showOtherFile">
						
					</div>
					<div class="quCoItem">
						<table class="mFillblankTable" cellpadding="0" cellspacing="0">
							{{#each questionMultiFillBlank}}
								<tr class="mFillblankTableTr">
									<td align="right" class="mFillblankTableEditTd">
										<label class="quCoOptionEdit">{{optionName}}：</label>
									</td>
									<td>
										<span class="detail-show">
										{{#each ../answer}}
											{{#compareCheckReturnStr ../id quItemId answer}}{{/compareCheckReturnStr}}
										{{/each}}
										</span>
									</td>
								</tr>
							{{/each}}
						</table>
					</div>
					<fieldset class="layui-elem-field site-demo-button">
						<legend>上传图片答案</legend>
  						<div>
    						<div class="upload questionPicture" id="questionPicture{{id}}"></div>
  						</div>
					</fieldset>
				</div>
			</div>
		</script>
		
		<!-- 11矩阵单选题chen-radio -->
		<script type="text/x-handlebars-template" id="chenRadioTemplate">
			<div class="surveyQuItem">
				<div class="surveyQuItemContent">
					<div class="quCoTitle">
						<div class="quCoNum">{{showQuestionIndex quType}}、</div>
						<div class="quCoTitleEdit">{{quTitle}}<span class="fraction">（{{fraction}}分）</span><span class="has-fraction">（得{{hasFraction}}分）</span></div>
					</div>
					<div class="showOtherFile">
						
					</div>
					<div class="quCoItem">
						<div class="quCoItemLeftChenTableDiv">
							<table class="quCoChenTable" >
								<tr><td></td>
									{{#each questionChenColumn}}
										<td class="quChenColumnTd">
											<label class="quCoOptionEdit">{{optionName}}</label>
										</td>
									{{/each}}
								</tr>
								{{#each questionChenRow}}
									<tr class="dwQuCoChenRowTr">
										<td class="quChenRowTd">
											<label class="quCoOptionEdit">{{optionName}}</label>
										</td>
										{{#each questionChenColumn}}
											<td>
												<div class="dwQuOptionItemContent">
													<label class="dwRedioStyle dwQuInputLabel
														{{#each ../../answer}}
															{{#compareCheckMore ../../id ../id quRowId  quColId}}{{/compareCheckMore}}
														{{/each}}
													" ></label>
												</div>
											</td>
										{{/each}}
									</tr>
								{{/each}}
							</table>
						</div>
					</div>
					<fieldset class="layui-elem-field site-demo-button">
						<legend>上传图片答案</legend>
  						<div>
    						<div class="upload questionPicture" id="questionPicture{{id}}"></div>
  						</div>
					</fieldset>
				</div>
			</div>
		</script>
		
		<!-- 13矩阵多选题chen-checkbox -->
		<script type="text/x-handlebars-template" id="chenCheckboxTemplate">
			<div class="surveyQuItem">
				<div class="surveyQuItemContent">
					<div class="quCoTitle">
						<div class="quCoNum">{{showQuestionIndex quType}}、</div>
						<div class="quCoTitleEdit" >{{quTitle}}<span class="fraction">（{{fraction}}分）</span><span class="has-fraction">（得{{hasFraction}}分）</span></div>
					</div>
					<div class="showOtherFile">
						
					</div>
					<div class="quCoItem">
						<div class="quCoItemLeftChenTableDiv">
							<table class="quCoChenTable" >
								<tr><td></td>
									{{#each questionChenColumn}}
										<td class="quChenColumnTd">
											<label class="quCoOptionEdit">{{optionName}}</label>
										</td>
									{{/each}}
								</tr>
								{{#each questionChenRow}}
									<tr class="dwQuCoChenRowTr">
										<td class="quChenRowTd">
											<label class="quCoOptionEdit">{{optionName}}</label>
										</td>
										{{#each questionChenColumn}}
											<td>
												<div class="dwQuOptionItemContent">
													<label class="dwCheckboxStyle dwQuInputLabel
														{{#each ../../answer}}
															{{#compareCheckMore ../../id ../id quRowId  quColId}}{{/compareCheckMore}}
														{{/each}}
													" ></label>
												</div>
											</td>
										{{/each}}
									</tr>
								{{/each}}
							</table>
						</div>
					</div>
					<fieldset class="layui-elem-field site-demo-button">
						<legend>上传图片答案</legend>
  						<div>
    						<div class="upload questionPicture" id="questionPicture{{id}}"></div>
  						</div>
					</fieldset>
				</div>
			</div>
		</script>
		
		<!-- 12矩阵填空题chen-fbk -->
		<script type="text/x-handlebars-template" id="chenFbkTemplate">
			<div class="surveyQuItem">
				<div class="surveyQuItemContent">
					<div class="quCoTitle">
						<div class="quCoNum">{{showQuestionIndex quType}}、</div>
						<div class="quCoTitleEdit" >{{quTitle}}<span class="fraction">（{{fraction}}分）</span><span class="has-fraction">（得{{hasFraction}}分）</span></div>
					</div>
					<div class="showOtherFile">
						
					</div>
					<div class="quCoItem">
						<div class="quCoItemLeftChenTableDiv">
							<table class="quCoChenTable" >
								<tr><td></td>
									{{#each questionChenColumn}}
										<td class="quChenColumnTd">
											<label class="quCoOptionEdit">{{optionName}}</label>
										</td>
									{{/each}}
								</tr>
								{{#each questionChenRow}}
									<tr class="dwQuCoChenRowTr">
										<td class="quChenRowTd">
											<label class="quCoOptionEdit">{{optionName}}</label>
										</td>
										{{#each questionChenColumn}}
											<td>
												<div class="dwQuChenFbkOptionItemContent">
													<span class="detail-show">
													{{#each ../../answer}}
														{{#compareCheckMoreReturnStr ../../id ../id quRowId  quColId answerValue}}{{/compareCheckMoreReturnStr}}
													{{/each}}
													</span>
												</div>
											</td>
										{{/each}}
									</tr>
								{{/each}}
							</table>
						</div>
					</div>
					<fieldset class="layui-elem-field site-demo-button">
						<legend>上传图片答案</legend>
  						<div>
    						<div class="upload questionPicture" id="questionPicture{{id}}"></div>
  						</div>
					</fieldset>
				</div>
			</div>
		</script>
		
		<!-- 18矩阵评分题chen-score -->
		<script type="text/x-handlebars-template" id="chenScoreTemplate">
			<div class="surveyQuItem">
				<div class="surveyQuItemContent">
					<div class="quCoTitle">
						<div class="quCoNum">{{showQuestionIndex quType}}、</div>
						<div class="quCoTitleEdit" >{{quTitle}}<span class="fraction">（{{fraction}}分）</span><span class="has-fraction">（得{{hasFraction}}分）</span></div>
					</div>
					<div class="showOtherFile">
						
					</div>
					<div class="quCoItem">
						<div class="quCoItemLeftChenTableDiv">
							<table class="quCoChenTable" >
								<tr><td></td>
									{{#each questionChenColumn}}
										<td class="quChenColumnTd">
											<label class="quCoOptionEdit">{{optionName}}</label>
										</td>
									{{/each}}
								</tr>
								{{#each questionChenRow}}
									<tr class="dwQuCoChenRowTr">
										<td class="quChenRowTd">
											<label class="quCoOptionEdit">{{optionName}}</label>
										</td>
										{{#each questionChenColumn}}
											<td>
												<div class="dwQuScoreOptionItemContent">
													<span class="detail-show">
													{{#each ../../answer}}
														{{#compareCheckMoreReturnStr ../../id ../id quRowId  quColId answserScore}}{{/compareCheckMoreReturnStr}}
													{{/each}}
													</span>
												</div>
											</td>
										{{/each}}
									</tr>
								{{/each}}
							</table>
						</div>
					</div>
					<fieldset class="layui-elem-field site-demo-button">
						<legend>上传图片答案</legend>
  						<div>
    						<div class="upload questionPicture" id="questionPicture{{id}}"></div>
  						</div>
					</fieldset>
				</div>
			</div>
		</script>
		
		<!-- 8评分题score -->
		<script type="text/x-handlebars-template" id="scoreTemplate">
			<div class="surveyQuItem">
				<div class="surveyQuItemContent">
					<div class="quCoTitle">
						<div class="quCoNum">{{showQuestionIndex quType}}、</div>
						<div class="quCoTitleEdit" >{{quTitle}}<span class="fraction">（{{fraction}}分）</span><span class="has-fraction">（得{{hasFraction}}分）</span></div>
					</div>
					<div class="showOtherFile">
						
					</div>
					<div class="quCoItem">
						<table class="quCoItemTable" cellpadding="0" cellspacing="0">
							{{#each quScores}}
								<tr class="quScoreOptionTr">
									<td class="quCoItemTableTd quOptionEditTd">
										<label class="quCoOptionEdit">{{optionName}}</label>
									</td>
									<td class="quCoItemTableTd">
										<table class="scoreNumTable" border="0" cellspacing="0" cellpadding="1" style="border-collapse: initial;">
											<tr>
												{{#showParamInt02 paramInt02 answserScore}}{{/showParamInt02}}
											</tr>
										</table>
									</td>
									<td class="quCoItemTableTd scoreNumText">分</td>
								</tr>
							{{/each}}
						</table>
					</div>
					<fieldset class="layui-elem-field site-demo-button">
						<legend>上传图片答案</legend>
  						<div>
    						<div class="upload questionPicture" id="questionPicture{{id}}"></div>
  						</div>
					</fieldset>
				</div>
			</div>
		</script>
		
		<script src="../../assets/lib/layui/layui.js"></script>
		<script src="../../assets/lib/layui/custom.js"></script>
		<script type="text/javascript">
			var quIndex = 0;//问题序号
			var pageNum = 1;//模拟页码
			var nowPageNum = 1;//当前页码
			
			layui.config({
				base: basePath,
				version: skyeyeVersion
			}).extend({
			    window: 'js/winui.window',
			}).define(['window', 'jquery', 'winui', 'validate', 'weixinAudio'], function(exports) {
				winui.renderColor();
				layui.use(['form', 'jqueryUI'], function(form) {
					var $ = layui.$,
						form = layui.form;
					//手机端加载该页面时加载userToken
					var userToken = GetUrlParam("userToken");
					if (!isNull(userToken)){
						setCookie('userToken', userToken);
					}
	 	   			showGrid({
						id: "wrap",
						url: schoolBasePath + "exam031",
						params: {answerId: getUrlParam("answerId")},
						pagination: false,
						template: getFileContent('tpl/examDetail/examPhoneDetail.tpl'),
						ajaxSendLoadBefore: function(hdb, json) {
							
							hdb.registerHelper('compareCheck', function(v1, v2) {
								if(v1 == v2) {
									return ' checked';
								} else {
									return '';
								}
							});
							hdb.registerHelper('compareCheckReturnStr', function(v1, v2, v3) {
								if(v1 == v2) {
									return v3;
								} else {
									return '';
								}
							});
							hdb.registerHelper('compareCheckMore', function(v1, v2, v3, v4) {
								if(v1 == v3 && v2 == v4) {
									return ' checked';
								} else {
									return '';
								}
							});
							hdb.registerHelper('compareCheckMoreReturnStr', function(v1, v2, v3, v4, v5) {
								if(v1 == v3 && v2 == v4) {
									return v5;
								} else {
									return '';
								}
							});
							
							hdb.registerHelper("showQuestionIndex", function(v1, options) {
								if(v1 == '16' || v1 == '17'){
								} else {
									quIndex++;
									return quIndex;
								}
							});
							
							hdb.registerHelper("showIndex", function(v1, options) {
								return parseInt(v1) + 1;
							});

							hdb.registerHelper("showParamInt02", function(v1, v2, options) {
								var str = "";
								for(var i = 1; i <= v1; i++) {
									if(i <= v2){
										str += "<td>" + i + "</td>";
									} else {
										str += "<td style='background-color: white;'>" + i + "</td>";
									}
								}
								return str;
							});

							hdb.registerHelper('compare1', function(v1, v2, options) {
								if(v1 == v2) {
									return options.fn(this);
								} else {
									return options.inverse(this);
								}
							});
							
							hdb.registerHelper('showQuestion', function(v1, i, options) {
					 			switch (v1) {
					 				case 1://1单选题radio
					 					return new Handlebars.SafeString(getDataUseHandlebars($("#radioTemplate").html(), json.rows[i]));
			      						break;
			      					case 2://2多选题checkbox
					 					return new Handlebars.SafeString(getDataUseHandlebars($("#checkBoxTemplate").html(), json.rows[i]));
			      						break;
			  						case 3://3填空题fillblank
					 					return new Handlebars.SafeString(getDataUseHandlebars($("#fillblankTemplate").html(), json.rows[i]));
			      						break;
			      					case 4://4多项填空题multi-fillblank
					 					return new Handlebars.SafeString(getDataUseHandlebars($("#multiFillblankTemplate").html(), json.rows[i]));
			      						break;
			      					case 8://8评分题score
					 					return new Handlebars.SafeString(getDataUseHandlebars($("#scoreTemplate").html(), json.rows[i]));
			      						break;
			      					case 9://9排序题orderby
					 					return new Handlebars.SafeString(getDataUseHandlebars($("#orderbyTemplate").html(), json.rows[i]));
			      						break;
			      					case 11://11矩阵单选题chen-radio
					 					return new Handlebars.SafeString(getDataUseHandlebars($("#chenRadioTemplate").html(), json.rows[i]));
			      						break;
			      					case 12://12矩阵填空题chen-fbk
					 					return new Handlebars.SafeString(getDataUseHandlebars($("#chenFbkTemplate").html(), json.rows[i]));
			      						break;
			      					case 13://13矩阵多选题chen-checkbox
					 					return new Handlebars.SafeString(getDataUseHandlebars($("#chenCheckboxTemplate").html(), json.rows[i]));
			      						break;
			      					case 16://16分页pagetag
					 					return new Handlebars.SafeString(getDataUseHandlebars($("#pagetagTemplate").html(), json.rows[i]));
			      						break;
			      					case 17://17段落paragraph
					 					return new Handlebars.SafeString(getDataUseHandlebars($("#paragraphTemplate").html(), json.rows[i]));
			      						break;
			      					case 18://18矩阵评分题chen-score
					 					return new Handlebars.SafeString(getDataUseHandlebars($("#chenScoreTemplate").html(), json.rows[i]));
			      						break;
					 			}
					 		});

							hdb.registerHelper('compare2', function(v1, v2, options) {
								if(v1 == v2) {
									return 'display: none;';
								} else {
									return '';
								}
							});

							hdb.registerHelper('compare3', function(v1, v2, options) {
								if(v1 > v2) {
									return options.fn(this);
								} else {
									return options.inverse(this);
								}
							});
							
							hdb.registerHelper('compare4', function(v1, options) {
								if(v1 == nowPageNum) {
									return '';
								} else {
									return 'display: none;';
								}
							});
							
							hdb.registerHelper('compare5', function(v1, options) {
								if(v1 == '16'){
									if(pageNum == '1'){
										pageNum++;
										return '';
									} else {
										pageNum++;
									}
								}
								if(pageNum == '1'){
									return '';
								} else {
									return 'display: none;';
								}
							});
							
							hdb.registerHelper('compare6', function(v1, options) {
								return pageNum;
							});
							
							hdb.registerHelper('compare7', function(v1, options) {
								if(nowPageNum == '1'){
									return options.inverse(this);
								} else {
									return options.fn(this);
								}
							});
							
							hdb.registerHelper('compare8', function(v1, v2) {
								if(v1 == 3){
									//填空题
									return '<input type="hidden" class="checkType" value="' + v2 + '">';
								}
								return "";
							});
							
							hdb.registerHelper('compare9', function(v1, v2, v3) {
								if(v1 == 8){
									//评分题
									return '<input type="hidden" class="geLe" value="' + v2 + '">'
											+ '<input type="hidden" class="scoreNum" value="' + v3 + '">';
								}
								return "";
							});
							
							hdb.registerHelper('compare10', function(v1, v2) {
								if(v1 == 2){
									//多选题
									return '<input type="hidden" name="qu_' + v1 + '_' + v2 + '" value="tag_qu_' + v1 + '_' + v2 + '_" />';
								} else if (v1 == 9 || v1 == 11 || v1 == 13 || v1 == 12 || v1 == 18 || v1 == 8){
									//排序题，矩阵单选题，矩阵多选题，矩阵填空题，矩阵评分题，评分题
									return '<input type="hidden" name="qu_' + v1 + '_' + v2 + '" value="item_qu_' + v1 + '_' + v2 + '_" />';
								} else if (v1 == 4){
									//多项填空题
									return '<input type="hidden" name="qu_' + v1 + '_' + v2 + '" value="text_qu_' + v1 + '_' + v2 + '_" />';
								}
								return "";
							});

							hdb.registerHelper("cellCount001", function(v1, options) {
								var str = "";
								var width = 600 / v1;
								for(var i = 1; i <= v1; i++) {
									str += '<td width="' + width + 'px">' +
										'<div class="dwQuOptionItemContent">' +
										'<label class="dwRedioStyle dwQuInputLabel" ></label>' +
										'<input type="radio" name="qu_{{quType}}_{{quId}}" value="{{id}}" >' +
										'<label style="width:' + (width - 10) + 'px;" class="editAble quCoOptionEdit quCoOptionPadding">{{optionName}}</label>' +
										'<input type="text" class="inputSytle_1" style="width:200px;padding:5px;{{#compare2 isNote 0}}{{/compare2}}" name="text_qu_{{quType}}_{{quId}}_{{id}}" />' +
										'</div>' +
										'</td>';
								}
								str += '<div class="emptyTd"></div>';
								return str;
							});

							hdb.registerHelper("cellCount002", function(v1, options) {
								var str = "";
								var width = 600 / v1;
								for(var i = 1; i <= v1; i++) {
									str += '<td width="' + width + 'px">' +
										'<div class="dwQuOptionItemContent">' +
										'<label class="dwCheckboxStyle dwQuInputLabel" ></label>' +
										'<input type="checkbox" name="tag_qu_{{quType}}_{{quId}}" value="{{id}}" >' +
										'<label style="width:' + (width - 10) + 'px;" class="editAble quCoOptionEdit quCoOptionPadding">{{optionName}}</label>' +
										'<input type="text" class="inputSytle_1" style="width:200px;padding:5px;{{#compare2 isNote 0}}{{/compare2}}" name="text_tag_qu_{{quType}}_{{quId}}_{{id}}" />' +
										'</div>' +
										'</td>';
								}
								str += '<div class="emptyTd"></div>';
								return str;
							});

							hdb.registerHelper("scoreNum001", function(v1, options) {
								var str = "";
								for(var i = 1; i <= v1; i++) {
									str += '<option value="' + i + '">' + i + '分</option>';
								}
								return str;
							});
						},
						ajaxSendAfter: function(json) {
							loadModel();
							
							loadOther(json);
						}
					});
	 	   			
	 	   			/**
	 	      		 * 加载视频，音频，图片等
	 	      		 */
	 	      		function loadOther(json){
	 	      			$.each(json.rows, function(m, bean){
		 	   				// 1.加载视频，音频，图片
		 	   				var qBodyItem = $("input[name='quId'][value='" + bean.id + "']").parents(".surveyQuItemBody");
		 	   				loadShowOtherFile(qBodyItem, bean);
		 	   				// 2.加载答案附件上传插件
		 	   				if(bean.whetherUpload == 1){
			 	   				loadUploadPic(qBodyItem, bean);
		 	   				} else {
		 	   					qBodyItem.find("fieldset").remove();
		 	   				}
	 	      			});
	 	      			form.render();
	 	      		}
					
					// 加载答案附件上传
					function loadUploadPic(qBodyItem, bean){
						var str = "";
						if (!isNull(bean.url)){
							$.each(bean.url.split(','), function(i, item) {
								if (!isNull(item)){
									str += '<img src="' + item + '" class="photo-img pictureItem">';
								}
							});
						}
						qBodyItem.find(".questionPicture").html(str);
					}
	 	   			
	 	   			// 加载视频，音频，图片等
	 	   			function loadShowOtherFile(qBodyItem, bean){
	 	   				var fileType = bean.fileType;
	 	   				var fileUrl = bean.fileUrl;
	 	   				var str = "";
	 	   				if(fileType == 1){
	 	   					// 视频
	 	   					str = '<div><img src="../../assets/images/icon/icon-vedio.png" class="questionShowVedio" fileUrl="' + fileUrl + '"/></div>';
	 	   				} else if (fileType == 2){
	 	   					// 音频
	 	   					str = '<div><img src="../../assets/images/icon/icon-audio.png" class="questionShowAudio" fileUrl="' + fileUrl + '" quTitle="' + bean.quTitle + '"/></div>';
	 	   				} else if (fileType == 3){
	 	   					// 图片
	 	   					str = '<img src="' + fileUrl + '" class="questionShowImg" />';
	 	   				}
	 	   				qBodyItem.find(".showOtherFile").html(str);
	 	   			}
	 	   			
	 	   			// 试题相关视频点击
	 	   			$("body").on("click", ".questionShowVedio", function (e) {
	 	   				var url = $(this).attr("fileUrl");
	 	   				var loadstr = '<video width="100%" height="99%" controls="controls" autobuffer="autobuffer" autoplay="autoplay" loop="loop">' 
	 	   								+ '<source src="' + url + '" type="video/mp4"></source></video>';
						layer.open({
							type: 1,
							title: '播放视频',
							area: ['70vw', '70vh'],
							content: loadstr,
							offset: 'auto'
						});
	 	   			});
	 	   			
	 	   			// 试题相关音频点击
	 	   			$("body").on("click", ".questionShowAudio", function (e) {
	 	   				var url = $(this).attr("fileUrl");
	 	   				var quTitle = $(this).attr("quTitle");
	 	   				var loadstr = '<p class="weixinAudio">'
	 	   								+ '<audio src="" id="media" width="1" height="1" preload></audio>'
	 	   								+ '<span id="audio_area" class="db audio_area">'
	 	   									+ '<span class="audio_wrp db">'
	 	   										+ '<span class="audio_play_area">'
	 	   											+ '<i class="icon_audio_default"></i>'
	 	   											+ '<i class="icon_audio_playing"></i>'
	 	   										+ '</span>'
	 	   										+ '<span id="audio_length" class="audio_length tips_global"></span>'
	 	   										+ '<span class="db audio_info_area">'
	 	   											+ '<strong class="db audio_title">' + quTitle + '</strong>'
	 	   											+ '<span class="audio_source tips_global">试题音频文件</span>'
	 	   										+ '</span>'
	 	   										+ '<span id="audio_progress" class="progress_bar" style="width: 0%;"></span>'
	 	   									+ '</span>'
						 	   			+ '</span>'
					 	   			+ '</p>';
		 	   			layer.open({
							type: 1,
							title: '播放音频',
							area: ['70vw', '110px'],
							content: loadstr,
							offset: 'auto',
							success: function(i){
								$('.weixinAudio').weixinAudio({
									autoplay: false,
									src: url
								});
							}
						});
	 	   			});
	 	   			
	 	   			// 试题相关图片点击
	 	   			$("body").on("click", ".questionShowImg, .pictureItem", function (e) {
	 	   				var url = $(this).attr("src");
	 	   				showPicDisk([url]);
	 	   			});

					//获取url中的参数
					function getUrlParam(name) {
						var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
						var r = window.location.search.substr(1).match(reg); //匹配目标参数
						if(r != null) return unescape(r[2]);
						return null; //返回参数值
					}

					//分页设置 nextPage_a prevPage_a
					$("body").on("click", ".nextPage_a", function(e) {
						var thParent = $(this).parent();
						nowPageNum = nowPageNum + 1;
						$(".li_surveyQuItemBody").hide();
						$(".surveyQu_" + nowPageNum).fadeIn("slow");
						$("html,body").animate({
							scrollTop: 10
						}, 500);
						return false;
					});
					$("body").on("click", ".prevPage_a", function(e) {
						var thParent = $(this).parent();
						nowPageNum = nowPageNum - 1;
						$(".li_surveyQuItemBody").hide();
						$(".surveyQu_" + nowPageNum).fadeIn("slow");
						$(window).scrollTop(10);
						return false;
					});
					
				    function loadModel(){
						/******************************处理题目逻辑设置 **************************************/
						//初始化 处理默认逻辑跳转为显示，则先隐藏元素
						var quLogics = $("#dwSurveyQuContent .quLogicItem");
						$.each(quLogics, function() {
							var loginItem = $(this);
							var cgQuItemId = loginItem.find(".cgQuItemId").val();
							var skQuId = loginItem.find(".skQuId").val();
							var logicId = loginItem.find(".logicId").val();
							var logicType = loginItem.find(".logicType").val();
							if(logicType === "2") {
								//逻辑类型为“显示”2  则初始化为隐藏
								var hidQuItemBody = $(".quId[value='" + skQuId + "']").parents(".li_surveyQuItemBody");
								hidQuItemBody.hide();
								hidQuItemBody.addClass("hidFor" + logicId);
								hidQuItemBody.find(".answerTag").attr("disabled", true);
							}
						});
				    }
					
				});
			});
		</script>
	</body>

</html>